import time

from lib.init.application_init import ApplicationInit
from lib.init.logger_init import LoggerInit
from lib.init.setting_init import SettingInit
from lib.utils.print_util import PrintUtil


class SystemInit(object):

    @staticmethod
    def start(server_name):
        start = int(time.time())
        PrintUtil.start("Start project and init setting file ...")
        PrintUtil.start("init setting file start...")
        SettingInit().start()
        LoggerInit.start(server_name)
        ApplicationInit.start(server_name)
        end = int(time.time())
        PrintUtil.start("Start project and init setting file is overtime, total second is %d" % (end - start))
